package com.msmall.community.admin.model;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import com.msmall.base.model.BaseObject;

@Entity
@Table(name="admin_resc")
public class AdminResc extends BaseObject {

	private static final long serialVersionUID = 8661790717734742561L;
	
	@Id
	@Column(name="resc_id")
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Long rescId;
	@Column(name="descn")
	private String descn;
	@Column(name="name")
	private String name;

	@Column(name="res_string")
	private String resString;

	@Column(name="res_type")
	private String resType;

	@ManyToMany
	@JoinTable(name="admin_role_resc",
		joinColumns=@JoinColumn(name="resc_id"),
		inverseJoinColumns=@JoinColumn(name="role_id"))
	private Set<AdminRole> adminRoleCollection;

	public AdminResc() {
		super();
	}

	public Long getRescId() {
		return this.rescId;
	}

	public void setRescId(Long rescId) {
		this.rescId = rescId;
	}

	public String getDescn() {
		return this.descn;
	}

	public void setDescn(String descn) {
		this.descn = descn;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getResString() {
		return this.resString;
	}

	public void setResString(String resString) {
		this.resString = resString;
	}

	public String getResType() {
		return this.resType;
	}

	public void setResType(String resType) {
		this.resType = resType;
	}

	public Set<AdminRole> getAdminRoleCollection() {
		return this.adminRoleCollection;
	}

	public void setAdminRoleCollection(Set<AdminRole> adminRoleCollection) {
		this.adminRoleCollection = adminRoleCollection;
	}

	@Override
	public boolean equals(Object o) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public int hashCode() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return null;
	}

}
